import request from "@/utils/request";

//分页获取商品
export const PageGoods = (data, current, size) => request.post('/goods/findPageGoods/' + current + '/' + size, data)
//上传商品
export const saveGoodsAndUploadImage = formData => request.post('/goods/saveGoods', formData, {headers: {'Content-Type': 'multipart/form-data'}})
//分页获取订单
export const getByDynamic = (data, current, size) => request.post('/goodsOrder/getByDynamic/' + current + '/' + size, data)
//添加商品记录
export const saveOrder = data => request.post('/goodsOrder/saveOrder', data)
//修改商品信息
export const updateGoods = formData => request.post('/goods/updateGoods', formData, {headers: {'Content-Type': 'multipart/form-data'}})
//获取所有商品名称
export const getAllGoodsNames = () => request.get('/goods/getAllGoodsNames')
//获取所有商品订单手机号
export const getAllPhone = () => request.get('/goodsOrder/getAllPhone')
//根据id删除器材
export const removeGoodsById = id => request.delete('/goods/removeGoodsById/' + id)